package com.hang.gymmanager.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.security.Timestamp;
import java.time.LocalDateTime;

/**
 * <p>
 * 支付宝支付订单表
 * </p>
 *
 * @author javgo
 * @since 2024-01-13
 */
@Getter
@Setter
@TableName("alipay_order")
public class AlipayOrderEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 订单ID
     */
    private String orderId;

    /**
     * 订单标题/商品标题/交易标题
     */
    private String subject;

    /**
     * 订单总金额
     */
    private BigDecimal totalAmount;

    /**
     * 交易状态，见 TradeStatusType
     */
    private Integer tradeStatus;

    /**
     * 商户订单号
     */
    private String outTradeNo;

    /**
     * 支付方式，见 PayMethod
     */
    private Integer payMethod;

    /**
     * 产品码
     */
    private String productCode;

    /**
     * 产品名称
     */
    private String productName;

    /**
     * 支付宝交易号
     */
    private String tradeNo;

    /**
     * 买家支付宝账号
     */
    private String buyerId;

    /**
     * 交易付款时间
     */
    private LocalDateTime gmtPayment;

    /**
     * 用户在交易中支付的金额
     */
    private BigDecimal buyerPayAmount;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
}
